package com.zrrd.yt.item.controller;

import com.zrrd.yt.common.result.Result;
import com.zrrd.yt.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/item")
public class ItemApiController {

    @Autowired
    private ItemService itemService;

    @GetMapping("/{skuId}")
    public Result getItem(@PathVariable("skuId") Long skuId){
        return Result.ok(itemService.getProductInfo(skuId));
    }
}
